//
//  UserViewCell.m
//  cookBook
//
//  Created by xalo on 16/1/23.
//  Copyright © 2016年 张广斌. All rights reserved.
//

#import "UserViewCell.h"
#import "Model.h"

@implementation UserViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setCellWithModel:(Model *)model
{
    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(deleteAction)];
    
    [self addGestureRecognizer:longPress];
    self.picture.image = model.pictureImage;
    self.title.text = model.title;
    
}

- (void)finishLongPress:(deleteBlock)block
{
    self.block = block;
}


- (void)deleteAction
{
    if (self.block) {
        _block();
    }
}



@end
